home *** CD-ROM | disk | FTP | other *** search
/ Champak 50 / Volume 50 - JOGO DISK .iso / Games / mallcrawl.swf / scripts / __Packages / mx / core / UIComponent.as < prev    next >
Encoding:
Text File  |  2007-09-28  |  4.0 KB  |  173 lines

  1. class mx.core.UIComponent extends mx.core.UIObject
  2. {
  3.    var __width;
  4.    var __height;
  5.    var stylecache;
  6.    var removeEventListener;
  7.    var dispatchEvent;
  8.    var drawFocus;
  9.    var addEventListener;
  10.    static var symbolName = "UIComponent";
  11.    static var symbolOwner = mx.core.UIComponent;
  12.    static var version = "2.0.2.126";
  13.    static var kStretch = 5000;
  14.    var focusEnabled = true;
  15.    var tabEnabled = true;
  16.    var origBorderStyles = {themeColor:16711680};
  17.    var clipParameters = {};
  18.    static var mergedClipParameters = mx.core.UIObject.mergeClipParameters(mx.core.UIComponent.prototype.clipParameters,mx.core.UIObject.prototype.clipParameters);
  19.    function UIComponent()
  20.    {
  21.       super();
  22.    }
  23.    function get width()
  24.    {
  25.       return this.__width;
  26.    }
  27.    function get height()
  28.    {
  29.       return this.__height;
  30.    }
  31.    function setVisible(x, noEvent)
  32.    {
  33.       super.setVisible(x,noEvent);
  34.    }
  35.    function enabledChanged(id, oldValue, newValue)
  36.    {
  37.       this.setEnabled(newValue);
  38.       this.invalidate();
  39.       delete this.stylecache.tf;
  40.       return newValue;
  41.    }
  42.    function setEnabled(enabled)
  43.    {
  44.       this.invalidate();
  45.    }
  46.    function getFocus()
  47.    {
  48.       var selFocus = Selection.getFocus();
  49.       return selFocus !== null ? eval(selFocus) : null;
  50.    }
  51.    function setFocus()
  52.    {
  53.       Selection.setFocus(this);
  54.    }
  55.    function getFocusManager()
  56.    {
  57.       var _loc2_ = this;
  58.       while(_loc2_ != undefined)
  59.       {
  60.          if(_loc2_.focusManager != undefined)
  61.          {
  62.             return _loc2_.focusManager;
  63.          }
  64.          _loc2_ = _loc2_._parent;
  65.       }
  66.       return undefined;
  67.    }
  68.    function onKillFocus(newFocus)
  69.    {
  70.       this.removeEventListener("keyDown",this);
  71.       this.removeEventListener("keyUp",this);
  72.       this.dispatchEvent({type:"focusOut"});
  73.       this.drawFocus(false);
  74.    }
  75.    function onSetFocus(oldFocus)
  76.    {
  77.       this.addEventListener("keyDown",this);
  78.       this.addEventListener("keyUp",this);
  79.       this.dispatchEvent({type:"focusIn"});
  80.       if(this.getFocusManager().bDrawFocus != false)
  81.       {
  82.          this.drawFocus(true);
  83.       }
  84.    }
  85.    function findFocusInChildren(o)
  86.    {
  87.       if(o.focusTextField != undefined)
  88.       {
  89.          return o.focusTextField;
  90.       }
  91.       if(o.tabEnabled == true)
  92.       {
  93.          return o;
  94.       }
  95.       return undefined;
  96.    }
  97.    function findFocusFromObject(o)
  98.    {
  99.       if(o.tabEnabled != true)
  100.       {
  101.          if(o._parent == undefined)
  102.          {
  103.             return undefined;
  104.          }
  105.          if(o._parent.tabEnabled == true)
  106.          {
  107.             o = o._parent;
  108.          }
  109.          else if(o._parent.tabChildren)
  110.          {
  111.             o = this.findFocusInChildren(o._parent);
  112.          }
  113.          else
  114.          {
  115.             o = this.findFocusFromObject(o._parent);
  116.          }
  117.       }
  118.       return o;
  119.    }
  120.    function pressFocus()
  121.    {
  122.       var _loc3_ = this.findFocusFromObject(this);
  123.       var _loc2_ = this.getFocus();
  124.       if(_loc3_ != _loc2_)
  125.       {
  126.          _loc2_.drawFocus(false);
  127.          if(this.getFocusManager().bDrawFocus != false)
  128.          {
  129.             _loc3_.drawFocus(true);
  130.          }
  131.       }
  132.    }
  133.    function releaseFocus()
  134.    {
  135.       var _loc2_ = this.findFocusFromObject(this);
  136.       if(_loc2_ != this.getFocus())
  137.       {
  138.          _loc2_.setFocus();
  139.       }
  140.    }
  141.    function isParent(o)
  142.    {
  143.       while(o != undefined)
  144.       {
  145.          if(o == this)
  146.          {
  147.             return true;
  148.          }
  149.          o = o._parent;
  150.       }
  151.       return false;
  152.    }
  153.    function size()
  154.    {
  155.    }
  156.    function init()
  157.    {
  158.       super.init();
  159.       this._xscale = 100;
  160.       this._yscale = 100;
  161.       this._focusrect = _global.useFocusRect == false;
  162.       this.watch("enabled",this.enabledChanged);
  163.       if(this.enabled == false)
  164.       {
  165.          this.setEnabled(false);
  166.       }
  167.    }
  168.    function dispatchValueChangedEvent(value)
  169.    {
  170.       this.dispatchEvent({type:"valueChanged",value:value});
  171.    }
  172. }
  173.